package com.ibm.sc.osp.sample.repository;

import com.ibm.sc.osp.sample.domain.entity.PfModel;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import javax.annotation.Nullable;


public interface PfModelRepository extends JpaRepository<PfModel, String> {
    
    boolean existsDistinctByTemplateNameAndSendMethod(String name, @Nullable String method);
    
    Page<PfModel> findAllByTemplateName(String name, Pageable pageable);
    
    Page<PfModel> findAllByTemplatType(String type, Pageable pageable);
    
    Page<PfModel> findAllBySendMethod(String method, Pageable pageable);
    
    Page<PfModel> findAllByTemplateNameAndTemplatType(String name, String type, Pageable pageable);
    
    Page<PfModel> findAllByTemplateNameAndSendMethod(String name, String method, Pageable pageable);
    
    Page<PfModel> findAllByTemplatTypeAndSendMethod(String type, String method, Pageable pageable);
    
    Page<PfModel> findAllByTemplateNameAndTemplatTypeAndSendMethod(String name, String type, String method, Pageable pageable);
}
